package com.xingkeduo.util.pojo.enums;

import com.xingkeduo.util.pojo.base.BaseEnum;

/**
 * 户口类型枚举
 * 
 * @author GJ
 * @time 2018年12月29日 下午4:42:18
 * @description
 */
public enum HouseHoldTypeEnum implements BaseEnum {
	OUTTERTOWN(1 ,"外埠城镇"),
	INNERTOWN(2 ,"本埠城镇"),
	OUTTERRURAL(3 ,"外埠农业"),	 
	INNERRURAL(4 ,"本埠农业");

	private int value;
	private String desc;

	private HouseHoldTypeEnum(int value, String desc) {
		this.value = value;
		this.desc = desc;
	}

	public static boolean validValue(String value) {
		int value_int = Integer.parseInt(value);
		return validValue(value_int);
	}

	public static boolean validValue(int value) {
		HouseHoldTypeEnum[] houseHoldTypes = HouseHoldTypeEnum.values();
		for (int i = 0; i < houseHoldTypes.length; i++) {
			if (houseHoldTypes[i].getValue() == value)
				return true;
		}
		return false;
	}

	public static HouseHoldTypeEnum getHouseHoldType(String value) {
		int value_int = Integer.parseInt(value);
		return getHouseHoldType(value_int);
	}

	public static HouseHoldTypeEnum getHouseHoldType(int value) {
		HouseHoldTypeEnum[] houseHoldTypes = HouseHoldTypeEnum.values();
		for (int i = 0; i < houseHoldTypes.length; i++) {
			if (houseHoldTypes[i].getValue() == value)
				return houseHoldTypes[i];
		}
		return null;
	}

	@Override
	public int getValue() {
		return this.value;
	}

	public String getDesc() {
		return desc;
	}
}
